package io;
//使用对象输入流进行对象的反序列化

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class OISDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        /*
        Object readObject();
        序列化的是哪个对象，反序列出来的也一定是那个对象
         */
        FileInputStream fis=new FileInputStream("student.obj");
        ObjectInputStream ois=new ObjectInputStream(fis);
        Object obj=ois.readObject();
        Student zs=(Student)obj;
        System.out.println(zs);
        ois.close();
    }
}
